package cn.wing.event;

import cn.wing.Inventory.PocketInventoryProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import static cn.wing.PlayTradingMain.MOD_ID;

@Mod.EventBusSubscriber
public class ModEvents {

    @SubscribeEvent
    public static void onAttach(AttachCapabilitiesEvent<Entity> e) {
        if (e.getObject() instanceof Player) {
            e.addCapability(ResourceLocation.fromNamespaceAndPath(MOD_ID, "pocket"),
                    new PocketInventoryProvider());
        }
    }

}
